package cn.minsh.lims.eoms.modules.job.task;

import cn.minsh.lims.eoms.modules.app.controller.res.InspectionPlanRes;
import cn.minsh.lims.eoms.modules.app.enums.PlanStatusEnum;
import cn.minsh.lims.eoms.modules.app.service.InspectionPlanService;
import cn.minsh.lims.eoms.modules.app.service.UserInspectionPlanService;
import cn.minsh.lims.eoms.modules.app.utils.LocalDateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;

/**
 * 创建巡检工单
 *  检查并且创建巡检工单任务
 * @author Administrator
 */
@Component("checkAndCreateInspectionOrderTask")
public class CheckAndCreateInspectionOrderTask implements ITask{

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private InspectionPlanService inspectionPlanService;
    @Autowired
    private UserInspectionPlanService userInspectionPlanService ;


    @Override
    public void run(String params) {
        List<InspectionPlanRes> list = inspectionPlanService.queryInspectionPlanList(PlanStatusEnum.STARTED.getCode()) ;
        userInspectionPlanService.saveBatchUserPlan(list);
    }
}
